<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车</title>
    <link rel="stylesheet" href="/css/order.css">
    <script src="/libs/require.js" data-main="/js/order.js"></script>
</head>
<body>
    <header></header>
    <div class="title">
        <h3 class="bx">我的购物车</h3>
        <div class="table">
            <table>
                <thead>
                    <tr>
                        <td><input type="checkbox" id="all-checked">商品</td>
                        <td>规格</td>
                        <td>单价</td>
                        <td>数量</td>
                        <td>小计</td>
                        <td>操作</td>
                    </tr>
                </thead>
                <tbody id="order-list">
                    
                </tbody>
            </table>
        </div>
        <script type="text/html" id="order-list-Template">
            {{each cart item}}
            <tr data-id={{item.id}}>
                <td>
                    <input type="checkbox" class="one-checked" {{ item.check?'checked':'' }}>
                    <a href="#"><img src="{{item.photo[0].url}}" alt=""></a>
                </td>
                <td>
                    <a href="#">{{item.title.slice(0,15)}}...</a>
                </td>
                <td>
                    2.0磅
                </td>
                <td>
                    {{item.price}}
                </td>
                <td>
                     <input type="button" value="-" class="sub">
                     <input type="text" value="{{item.count}}" class="sum">
                     <input type="button" value="+" class="plus">
                </td>
                <td class="order-price">
                    {{(item.price*item.count).toFixed(2)}}
                </td>
                <td class='del'>
                   X
                </td> 
             </tr>
             {{/each}}
        </script>

        <div class="empty" id="cart-empty">
            <p>耗子🐀来了都是哭着走的</p>
            <a href="/index.html">返回首页</a>
            <a href="/html/cake-list.html">赶紧去买买买</a>
        </div>

        <div class="a-price">
            商品 | 合计：<span id="paymoney">0</span>元
        </div>
        <div class="order-btn">
            <a href="/html/cake-list.html"><input type="button" value="继续购物" id="order-more"></a>
            <a href="/html/finish.html"><input type="button" value="下单结算" id="order-pay"></a>   
        </div>
        <footer></footer>
    </div>
    
</body>
</html>